using UsrControls;

namespace MinCultura.Sinic.UsrControls
{ 
	public class PopupPanelBase : PopupPanel
	{ 
		
		#region Properties

		public string BasePath
		{
			get
			{
				return DefaultPath();
			}
		}
		
		#endregion

		#region Metodos

		protected string DefaultPath()
		{
            
			string mstrPort = Page.Request.ServerVariables["SERVER_PORT"];
			string mstrProtocol = Page.Request.ServerVariables["SERVER_PORT_SECURE"];
			string mstrPath = Page.Request.ApplicationPath;

			if (mstrPort == null || mstrPort == "80" || mstrPort == "443")
				mstrPort = "";
			else
				mstrPort = ":" + mstrPort;

			if (mstrProtocol == null || mstrProtocol == "0")
				mstrProtocol = "http://";
			else
				mstrProtocol = "https://";

			if (mstrPath == null || mstrPath == "/")
				mstrPath = "";
			else
				mstrPath = mstrPath;

			// *** Construccion del Url base el cual apunta  a la raiz de la aplicacion
			return mstrProtocol + Page.Request.ServerVariables["SERVER_NAME"] + mstrPort + mstrPath;
		}

		#endregion
	} 
} 
